﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebClient._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript">
    function GetData() {
        var a = document.getElementById('MainContent_txt1').value;
        var b = document.getElementById('MainContent_txt2').value;
        PageMethods.GetData(a, b, resultfunction, errorfunction);
    }

    function resultfunction(args) {
        var x = document.getElementById('MainContent_lbl1');
        x.innerHTML = args;
    }
    function errorfunction(error) {
    }

</script>

</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
    <h2>
        Welcome to ASP.NET!
    </h2>
    <p>
        To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>.
    </p>
    <p>
        You can also find <a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;clcid=0x409"
            title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>.
    </p>



    <asp:TextBox ID="txt1" runat="server"></asp:TextBox>
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>
    <%--<asp:Button ID="btn1" runat="server" Text ="GetData"  OnClick="btn_Click"/>--%>
    <input id="Button1" type="button" value="Get Data" onclick="GetData()" />
    <br />
    <asp:Label runat="server" ID="lbl1" Text=""></asp:Label>
</asp:Content>
